function fans() {
	var o = this;
	this.init = function() {
		return o
	};
	this.submit = function(FansUID, FansStatus, obj, fn) {
		if (FansStatus == -1) {
			location.href = "/reg/login.html"
		} else {
			if (FansUID <= 0) {
				o.jalert("闈炴硶鎿嶄綔")
			} else {
				if (FansStatus == 0) {
					o.submitdb(FansUID, FansStatus, obj, fn)
				} else {
					$.jconfirm("", "纭畾鍙栨秷鍏虫敞鍚楋紵", 400, function() {
						o.submitdb(FansUID, FansStatus, obj, fn)
					})
				}
			}
		}
	};
	this.submitdb = function(FansUID, FansStatus, obj, fn) {
		var _this = $(obj);
		var oldClick = _this.attr("onclick");
		glb.ajax(glb.ajaxUcUrl + "savefans", "JSON", "FansUID=" + FansUID + "&FansStatus=" + FansStatus, function() {
			_this.attr("onclick", "")
		}, function(data) {
			var d = eval(data);
			if (d.status == 1) {
				$.jsuccess((FansStatus == 0 ? "鍏虫敞鎴愬姛" : "宸插彇娑堝叧娉�"), 250, null, null);
				_this.text((FansStatus == 0 ? "鍙栨秷鍏虫敞" : "缁х画鍏虫敞"));
				fn.call()
			} else {
				if (d.status == 2) {
					o.jalert("鎶辨瓑锛岀郴缁熸娴嬪埌鎮ㄦ湁涓ラ噸杩濊鎿嶄綔琛屼负锛屽凡琚姝㈡搷浣�")
				} else {
					if (d.status == 3) {
						o.jalert("鎶辨瓑锛屾偍浠婃棩鐨勫叧娉ㄦ暟宸茶揪涓婇檺")
					} else {
						if (d.status == 4) {
							o.jalert("鎶辨瓑锛屾偍宸茶缃戠珯绠＄悊鍛樻媺鍏ラ粦鍚嶅崟锛屼笉鑳借繘琛屼换浣曚簰鍔�")
						} else {
							if (d.status == 5) {
								o.jalert("鎶辨瓑锛屾偍瑕佸叧娉ㄧ殑鐢ㄦ埛鎶婃偍鎷夊叆榛戝悕鍗曚簡")
							} else {
								if (d.status == 6) {
									$.jconfirm("", "璇峰厛婵€娲昏处鍙锋墠鑳戒娇鐢ㄥ叧娉ㄥ姛鑳斤紝纭畾瑕佹縺娲昏处鍙峰悧锛�<br /><br />", 500, function() {
										$.jfnclose();
										location.href = "/reg/verify.html"
									})
								} else {
									if (d.status == 7) {
										$.jconfirm("", "鎮ㄧ殑鍜ㄨ甯堣处鍙峰皻鏈€氳繃瀹℃牳锛屼笉鑳戒娇鐢ㄥ叧娉ㄥ姛鑳斤紝纭畾瑕佹煡鐪嬪鏍哥姸鎬佸悧锛�<br /><br />", 600, function() {
											$.jfnclose();
											location.href = "/reg/success.html"
										})
									} else {
										if (d.status == 8) {
											o.jalert("鑷繁涓嶈兘鍏虫敞鑷繁")
										} else {
											_this.attr("onclick", oldClick);
											o.jalert("鎿嶄綔澶辫触锛岀郴缁熺箒蹇欙紒")
										}
									}
								}
							}
						}
					}
				}
			}
		}, function() {
			_this.attr("onclick", oldClick);
			o.jalert("鎿嶄綔澶辫触锛岀郴缁熺箒蹇欙紒")
		})
	};
	this.myFans = function(typeId, uid) {
		location.href = uid == -1 ? "/reg/login.html" : ("/fans/" + typeId + "/" + uid + ".html")
	};
	this.jalert = function(info) {
		$.jalerttimer("鎿嶄綔鎻愮ず", info + "<br /><br />", 650, function() {
			$.jfnclose()
		}, 9)
	}
};
